cmake_minimum_required (VERSION 3.18)

project(Demo LANGUAGES C CXX CUDA)

#=======================================================================

find_package(CUDAToolkit REQUIRED)
set(CMAKE_CUDA_ARCHITECTURES native)

# #==============================================
# find_package(OpenMP)
# message("OpenMP FLAGS:" ${OpenMP_C_FLAGS})
# #===============================================
# find_package(MPI)
# message("Thist is a MPI build:" ${MPI_FOUND})
# #===============================================

include_directories("./include")

file(GLOB src_file 
    "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"    
    "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cu"
    "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
)

message(STATUS "src_file = ${src_file}")

add_library(cuda_gemm
    STATIC
    ${src_file}
) 

add_executable(LearnCUDA main.cpp)
#target_compile_features(Demo PUBLIC cxx_std_14)
#set_target_properties(Demo PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_link_libraries(LearnCUDA cuda_gemm CUDA::cublas CUDA::cusparse CUDA::cusolver CUDA::nppc CUDA::nvToolsExt)
